﻿@{
    Layout = null;
    ViewData["Title"] = "Index";
}

<link rel="stylesheet" href="~/Content/bootstrap-theme.css" media="all"/>
<link rel="stylesheet" href="~/layui/css/layui.css">
<link rel="stylesheet" href="~/layer/skin/layer.css">

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>TMS智慧物流平台登录</title>
    <style type="text/css">
        .container {
            width: 420px;
            height: 500px;
            min-height: 300px;
            max-height: 400px;
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            margin: auto;
            padding: 20px;
            z-index: 130;
            border-radius: 8px;
            background-color: #fff;
            box-shadow: 0 3px 18px rgba(100, 0, 0, .5);
            font-size: 16px;
        }


        .layui-input {
            width: 300px;
            height: 40px;
            font-size: 15px;
            border-style: none;
            display: flex;
            border: 1px solid #D2D2D2 !important;
            background-color: #fff;
            line-height: 38px;
            padding: 0px 19px;
            border-radius: 19px;
            margin-left: 60px;
        }

        #logoid {
            margin-top: -16px;
            padding-left: 140px;
            padding-bottom: 15px;
        }

        .layui-btn {
            margin-top: -5px;
            margin-left: -63px;
            border-radius: 10px;
            width: 330px;
            height: 40px;
            font-size: 20px;
            background-color: #1abc9c;
        }

        .scpn {
            font-size: 30px;
            color: #1abc9c;
            font-family: "楷体 Bold", "楷体 Regular", 楷体, sans-serif;
            font-weight: 700;
            margin-left: 120px;
        }

        .pro_name a { color: #4183c4; }

        .osc_git_title { background-color: #fff; }

        .osc_git_box { background-color: #fff; }

        .osc_git_box { border-color: #E3E9ED; }

        .osc_git_info { color: #666; }

        .osc_git_main a { color: #9B9B9B; }
    </style>
</head>
<body>
<form class="layui-form" action="" method="post">
    <div class="container">
        <div class="layui-form-mid layui-word-aux">
            <img id="logoid" src="~/img/TMS.png"/>
        </div>
        <span class="scpn">TMS智慧物流</span>
        <br/>
        <span class="scpn">系统管理后台</span>
        <div class="layui-form-item">
            <div class="layui-input-inline">
                <input type="text" name="accountNumber" value="admin" icon="&#xe68e;" lay-verify="required" autocomplete="off" placeholder="请输入用户名称" class="layui-input" style="text-align: center; background-color: #f3fdff">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-inline">
                <input type="password" name="password" value="123456" lay-verify="required" autocomplete="off" placeholder="请输入登录密码" class="layui-input" style="text-align: center; background-color: #f3fdff">
            </div>
        </div>
        <div style="font-size: 12px; margin-block: 5px;">
            &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
            <a style="color: blue" href="/Login/ForgetPasswordView">忘记密码?</a>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">登陆</button>
            </div>
        </div>
    </div>
</form>
<dialog ></dialog>
<script src="~/Scripts/jquery-3.4.1.min.js"></script>
<script src="~/layui/layui.js"></script>
<script src="~/layer/layer.js"></script>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;
  
        //监听提交
        form.on('submit(formDemo)', function(data){
            var accountNumber = data.field.accountNumber;
            var password = data.field.password;
            var regular = /^[A-Za-z0-9]{4,20}$/; //正则
            if (!regular.test(accountNumber)) {
                layer.msg("禁止输入特殊字符,账号格式为4-20位英文和数字");
                return false;
            }
            if (!regular.test(password)) {
                layer.msg("禁止输入特殊字符,密码格式为4-20位英文和数字");
                return false;
            }
            $.get("/Login/DoLogin?accountNumber=" + accountNumber + "&password=" + password,
                function(res) {
                    if (res > 0) {
                        location.href = "/Login/FaceIndex";
                    } else {
                        layer.msg("用户名或密码错误!");
                    }
                });
            return false;
        });
    });
</script>
</body>
</html>